@echo off
REM 检查是否提供了函数名参数
if "%~1"=="" (
    echo Usage: run_function_cycles.bat ^<function_name^>
    exit /b 1
)

REM 设置Python脚本路径
set PYTHON_SCRIPT=get_funcCycles.py

REM 检查Python脚本是否存在
if not exist "%PYTHON_SCRIPT%" (
    echo Python script %PYTHON_SCRIPT% not found.
    echo Please make sure the script exists in the same directory as this batch file.
    exit /b 1
)

REM 提示用户Python脚本将被执行
echo Running Python script to analyze function lifecycle...

REM 调用Python脚本并传递函数名参数
python "%PYTHON_SCRIPT%" "%~1"

REM 检查Python脚本的退出代码
if %errorlevel% neq 0 (
    echo Python script execution failed.
    exit /b %errorlevel%
)

echo Function lifecycle analysis completed successfully.
exit /b 0
